﻿#Region "Microsoft.VisualBasic::6b8b4721d3924148a404fa3ab27a9a24, Google.Protobuf\WellKnownTypes\Api\Api.vb"

    ' Author:
    ' 
    '       asuka (amethyst.asuka@gcmodeller.org)
    '       xie (genetics@smrucc.org)
    '       xieguigang (xie.guigang@live.com)
    ' 
    ' Copyright (c) 2018 GPL3 Licensed
    ' 
    ' 
    ' GNU GENERAL PUBLIC LICENSE (GPL3)
    ' 
    ' 
    ' This program is free software: you can redistribute it and/or modify
    ' it under the terms of the GNU General Public License as published by
    ' the Free Software Foundation, either version 3 of the License, or
    ' (at your option) any later version.
    ' 
    ' This program is distributed in the hope that it will be useful,
    ' but WITHOUT ANY WARRANTY; without even the implied warranty of
    ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    ' GNU General Public License for more details.
    ' 
    ' You should have received a copy of the GNU General Public License
    ' along with this program. If not, see <http://www.gnu.org/licenses/>.



    ' /********************************************************************************/

    ' Summaries:

    '     Class Api
    ' 
    '         Properties: Descriptor, DescriptorProp, Methods, Mixins, Name
    '                     Options, Parser, SourceContext, Syntax, Version
    ' 
    '         Constructor: (+2 Overloads) Sub New
    ' 
    '         Function: CalculateSize, Clone, (+2 Overloads) Equals, GetHashCode, ToString
    ' 
    '         Sub: (+2 Overloads) MergeFrom, OnConstruction, WriteTo
    ' 
    ' 
    ' /********************************************************************************/

#End Region

' Generated by the protocol buffer compiler.  DO NOT EDIT!
' source: google/protobuf/api.proto
#Region "Designer generated code"

Imports Microsoft.VisualBasic.Language
Imports pbc = Google.Protobuf.Collections
Imports pbr = Google.Protobuf.Reflection

Namespace Google.Protobuf.WellKnownTypes

#Region "Messages"
    ''' <summary>
    '''  Api is a light-weight descriptor for a protocol buffer service.
    ''' </summary>
    Public NotInheritable Partial Class Api
        Implements IMessageType(Of Api)

        Private Shared ReadOnly _parser As MessageParserType(Of Api) = New MessageParserType(Of Api)(Function() New Api())

        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute>
        Public Shared ReadOnly Property Parser As MessageParserType(Of Api)
            Get
                Return _parser
            End Get
        End Property

        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute>
        Public Shared ReadOnly Property DescriptorProp As pbr.MessageDescriptor
            Get
                Return Global.Google.Protobuf.WellKnownTypes.ApiReflection.Descriptor.MessageTypes(0)
            End Get
        End Property

        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute>
        Private ReadOnly Property Descriptor As pbr.MessageDescriptor Implements IMessage.Descriptor
            Get
                Return DescriptorProp
            End Get
        End Property

        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute>
        Public Sub New()
            OnConstruction()
        End Sub

        Partial Private Sub OnConstruction()
        End Sub

        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute>
        Public Sub New(other As Api)
            Me.New()
            name_ = other.name_
            methods_ = other.methods_.Clone()
            options_ = other.options_.Clone()
            version_ = other.version_
            SourceContext = If(other.sourceContext_ IsNot Nothing, other.SourceContext.Clone(), Nothing)
            mixins_ = other.mixins_.Clone()
            syntax_ = other.syntax_
        End Sub

        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute>
        Public Function Clone() As Api Implements IDeepCloneable(Of Api).Clone
            Return New Api(Me)
        End Function

        ''' <summary>Field number for the "name" field.</summary>
        Public Const NameFieldNumber As Integer = 1
        Private name_ As String = ""
        ''' <summary>
        '''  The fully qualified name of this api, including package name
        '''  followed by the api's simple name.
        ''' </summary>
        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute>
        Public Property Name As String
            Get
                Return name_
            End Get
            Set(value As String)
                name_ = CheckNotNull(value, "value")
            End Set
        End Property

        ''' <summary>Field number for the "methods" field.</summary>
        Public Const MethodsFieldNumber As Integer = 2
        Private Shared ReadOnly _repeated_methods_codec As FieldCodecType(Of Global.Google.Protobuf.WellKnownTypes.Method) = FieldCodec.ForMessage(18, Global.Google.Protobuf.WellKnownTypes.Method.Parser)
        Private ReadOnly methods_ As pbc.RepeatedField(Of Global.Google.Protobuf.WellKnownTypes.Method) = New pbc.RepeatedField(Of Global.Google.Protobuf.WellKnownTypes.Method)()
        ''' <summary>
        '''  The methods of this api, in unspecified order.
        ''' </summary>
        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute>
        Public ReadOnly Property Methods As pbc.RepeatedField(Of Global.Google.Protobuf.WellKnownTypes.Method)
            Get
                Return methods_
            End Get
        End Property

        ''' <summary>Field number for the "options" field.</summary>
        Public Const OptionsFieldNumber As Integer = 3
        Private Shared ReadOnly _repeated_options_codec As FieldCodecType(Of Global.Google.Protobuf.WellKnownTypes.Option) = FieldCodec.ForMessage(26, Global.Google.Protobuf.WellKnownTypes.Option.Parser)
        Private ReadOnly options_ As pbc.RepeatedField(Of Global.Google.Protobuf.WellKnownTypes.Option) = New pbc.RepeatedField(Of Global.Google.Protobuf.WellKnownTypes.Option)()
        ''' <summary>
        '''  Any metadata attached to the API.
        ''' </summary>
        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute>
        Public ReadOnly Property Options As pbc.RepeatedField(Of Global.Google.Protobuf.WellKnownTypes.Option)
            Get
                Return options_
            End Get
        End Property

        ''' <summary>Field number for the "version" field.</summary>
        Public Const VersionFieldNumber As Integer = 4
        Private version_ As String = ""
        ''' <summary>
        '''  A version string for this api. If specified, must have the form
        '''  `major-version.minor-version`, as in `1.10`. If the minor version
        '''  is omitted, it defaults to zero. If the entire version field is
        '''  empty, the major version is derived from the package name, as
        '''  outlined below. If the field is not empty, the version in the
        '''  package name will be verified to be consistent with what is
        '''  provided here.
        '''
        '''  The versioning schema uses [semantic
        '''  versioning](http://semver.org) where the major version number
        '''  indicates a breaking change and the minor version an additive,
        '''  non-breaking change. Both version numbers are signals to users
        '''  what to expect from different versions, and should be carefully
        '''  chosen based on the product plan.
        '''
        '''  The major version is also reflected in the package name of the
        '''  API, which must end in `v&lt;major-version>`, as in
        '''  `google.feature.v1`. For major versions 0 and 1, the suffix can
        '''  be omitted. Zero major versions must only be used for
        '''  experimental, none-GA apis.
        ''' </summary>
        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute>
        Public Property Version As String
            Get
                Return version_
            End Get
            Set(value As String)
                version_ = CheckNotNull(value, "value")
            End Set
        End Property

        ''' <summary>Field number for the "source_context" field.</summary>
        Public Const SourceContextFieldNumber As Integer = 5
        Private sourceContext_ As Global.Google.Protobuf.WellKnownTypes.SourceContext
        ''' <summary>
        '''  Source context for the protocol buffer service represented by this
        '''  message.
        ''' </summary>
        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute>
        Public Property SourceContext As Global.Google.Protobuf.WellKnownTypes.SourceContext
            Get
                Return sourceContext_
            End Get
            Set(value As Global.Google.Protobuf.WellKnownTypes.SourceContext)
                sourceContext_ = value
            End Set
        End Property

        ''' <summary>Field number for the "mixins" field.</summary>
        Public Const MixinsFieldNumber As Integer = 6
        Private Shared ReadOnly _repeated_mixins_codec As FieldCodecType(Of Global.Google.Protobuf.WellKnownTypes.Mixin) = FieldCodec.ForMessage(50, Global.Google.Protobuf.WellKnownTypes.Mixin.Parser)
        Private ReadOnly mixins_ As pbc.RepeatedField(Of Global.Google.Protobuf.WellKnownTypes.Mixin) = New pbc.RepeatedField(Of Global.Google.Protobuf.WellKnownTypes.Mixin)()
        ''' <summary>
        '''  Included APIs. See [Mixin][].
        ''' </summary>
        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute>
        Public ReadOnly Property Mixins As pbc.RepeatedField(Of Global.Google.Protobuf.WellKnownTypes.Mixin)
            Get
                Return mixins_
            End Get
        End Property

        ''' <summary>Field number for the "syntax" field.</summary>
        Public Const SyntaxFieldNumber As Integer = 7
        Private syntax_ As Global.Google.Protobuf.WellKnownTypes.Syntax = 0
        ''' <summary>
        '''  The source syntax of the service.
        ''' </summary>
        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute>
        Public Property Syntax As Global.Google.Protobuf.WellKnownTypes.Syntax
            Get
                Return syntax_
            End Get
            Set(value As Global.Google.Protobuf.WellKnownTypes.Syntax)
                syntax_ = value
            End Set
        End Property

        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute>
        Public Overrides Function Equals(other As Object) As Boolean
            Return Equals(TryCast(other, Api))
        End Function

        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute>
        Public Overloads Function Equals(other As Api) As Boolean Implements IEquatable(Of Api).Equals
            If ReferenceEquals(other, Nothing) Then
                Return False
            End If

            If ReferenceEquals(other, Me) Then
                Return True
            End If

            If Not Equals(Name, other.Name) Then Return False
            If Not methods_.Equals(other.methods_) Then Return False
            If Not options_.Equals(other.options_) Then Return False
            If Not Equals(Version, other.Version) Then Return False
            If Not Object.Equals(SourceContext, other.SourceContext) Then Return False
            If Not mixins_.Equals(other.mixins_) Then Return False
            If Syntax <> other.Syntax Then Return False
            Return True
        End Function

        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute>
        Public Overrides Function GetHashCode() As Integer
            Dim hash = 1
            If Name.Length <> 0 Then hash = hash Xor Name.GetHashCode()
            hash = hash Xor methods_.GetHashCode()
            hash = hash Xor options_.GetHashCode()
            If Version.Length <> 0 Then hash = hash Xor Version.GetHashCode()
            If sourceContext_ IsNot Nothing Then hash = hash Xor SourceContext.GetHashCode()
            hash = hash Xor mixins_.GetHashCode()
            If Syntax <> 0 Then hash = hash Xor Syntax.GetHashCode()
            Return hash
        End Function

        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute>
        Public Overrides Function ToString() As String
            Return JsonFormatter.ToDiagnosticString(Me)
        End Function

        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute>
        Public Sub WriteTo(output As CodedOutputStream) Implements IMessage.WriteTo
            If Name.Length <> 0 Then
                output.WriteRawTag(10)
                output.WriteString(Name)
            End If

            methods_.WriteTo(output, _repeated_methods_codec)
            options_.WriteTo(output, _repeated_options_codec)

            If Version.Length <> 0 Then
                output.WriteRawTag(34)
                output.WriteString(Version)
            End If

            If sourceContext_ IsNot Nothing Then
                output.WriteRawTag(42)
                output.WriteMessage(SourceContext)
            End If

            mixins_.WriteTo(output, _repeated_mixins_codec)

            If Syntax <> 0 Then
                output.WriteRawTag(56)
                output.WriteEnum(CInt(Syntax))
            End If
        End Sub

        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute>
        Public Function CalculateSize() As Integer Implements IMessage.CalculateSize
            Dim size = 0

            If Name.Length <> 0 Then
                size += 1 + CodedOutputStream.ComputeStringSize(Name)
            End If

            size += methods_.CalculateSize(_repeated_methods_codec)
            size += options_.CalculateSize(_repeated_options_codec)

            If Version.Length <> 0 Then
                size += 1 + CodedOutputStream.ComputeStringSize(Version)
            End If

            If sourceContext_ IsNot Nothing Then
                size += 1 + CodedOutputStream.ComputeMessageSize(SourceContext)
            End If

            size += mixins_.CalculateSize(_repeated_mixins_codec)

            If Syntax <> 0 Then
                size += 1 + CodedOutputStream.ComputeEnumSize(CInt(Syntax))
            End If

            Return size
        End Function

        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute>
        Public Sub MergeFrom(other As Api) Implements IMessageType(Of Api).MergeFrom
            If other Is Nothing Then
                Return
            End If

            If other.Name.Length <> 0 Then
                Name = other.Name
            End If

            methods_.Add(other.methods_)
            options_.Add(other.options_)

            If other.Version.Length <> 0 Then
                Version = other.Version
            End If

            If other.sourceContext_ IsNot Nothing Then
                If sourceContext_ Is Nothing Then
                    sourceContext_ = New Global.Google.Protobuf.WellKnownTypes.SourceContext()
                End If

                SourceContext.MergeFrom(other.SourceContext)
            End If

            mixins_.Add(other.mixins_)

            If other.Syntax <> 0 Then
                Syntax = other.Syntax
            End If
        End Sub

        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute>
        Public Sub MergeFrom(input As CodedInputStream) Implements IMessage.MergeFrom
            Dim tag As New Value(Of UInteger)

            While ((tag = input.ReadTag())) <> 0

                Select Case tag.Value
                    Case 10
                        Name = input.ReadString()

                    Case 18
                        methods_.AddEntriesFrom(input, _repeated_methods_codec)

                    Case 26
                        options_.AddEntriesFrom(input, _repeated_options_codec)

                    Case 34
                        Version = input.ReadString()

                    Case 42

                        If sourceContext_ Is Nothing Then
                            sourceContext_ = New Global.Google.Protobuf.WellKnownTypes.SourceContext()
                        End If

                        input.ReadMessage(sourceContext_)

                    Case 50
                        mixins_.AddEntriesFrom(input, _repeated_mixins_codec)

                    Case 56
                        syntax_ = CType(input.ReadEnum(), Global.Google.Protobuf.WellKnownTypes.Syntax)

                    Case Else
                        input.SkipLastField()
                End Select
            End While
        End Sub
    End Class

#End Region

End Namespace
#End Region
